﻿@model RoleDto

<util-toolbar>
    <util-layout>
        <util-a styles="Icon" tooltip="添加角色" link="create">
            <util-icon font-awesome-icon="Plus"></util-icon>
        </util-a>
        <util-button id="btnDisable" styles="Icon" tooltip="批量禁用" on-click="disable(null,btnDisable)">
            <util-icon font-awesome-icon="Lock"></util-icon>
        </util-button>
        <util-button id="btnEnable" styles="Icon" tooltip="批量启用" on-click="enable(null,btnEnable)">
            <util-icon font-awesome-icon="Unlock"></util-icon>
        </util-button>
        <util-button id="btnDelete" styles="Icon" tooltip="批量删除" on-click="delete(null,btnDelete)">
            <util-icon font-awesome-icon="Trash"></util-icon>
        </util-button>
        <util-button id="btnRefresh" styles="Icon" tooltip="刷新" on-click="refresh(btnRefresh)">
            <util-icon font-awesome-icon="Refresh"></util-icon>
        </util-button>
    </util-layout>
</util-toolbar>
<util-layout flex="100%">
    <util-textbox model="queryParam.keyword" placeholder="搜索" on-change="search()"></util-textbox>
</util-layout>
<util-tree-table id="treeTable_role" base-url="role" query-param="queryParam" selection-mode="Multiple" key="treeTable_role" >
    <util-tree-table-column for="Name"></util-tree-table-column>
    <util-tree-table-column for="Code"></util-tree-table-column>
    <util-tree-table-column for="Enabled"></util-tree-table-column>
    <util-tree-table-column for="SortId"></util-tree-table-column>
    <util-tree-table-column title="操作">
        <util-a styles="Icon" tooltip="添加下级角色" link="create" query-params="{id:row.data.id}">
            <util-icon material-icon="Add"></util-icon>
        </util-a>
        <util-button id="btnMoveUp" styles="Icon" tooltip="上移" ng-if="!isFirst(row)" on-click="moveUp(row,btnMoveUp,$event)">
            <util-icon material-icon="Arrow_Upward"></util-icon>
        </util-button>
        <util-button id="btnMoveDown" styles="Icon" tooltip="下移" ng-if="!isLast(row)" on-click="moveDown(row, btnMoveDown,$event)">
            <util-icon material-icon="Arrow_Downward"></util-icon>
        </util-button>
        <util-button styles="Icon" menu-id="menu" on-click="selectRow(row,$event)">
            <util-icon material-icon="More_Vert"></util-icon>
            <util-menu id="menu">
                <util-menu-item label="编辑" material-icon="Edit" bind-link="['update',row.data.id]"></util-menu-item>
                <util-menu-item label="禁用" material-icon="Lock" on-click="disable(row)"></util-menu-item>
                <util-menu-item label="启用" material-icon="Lock_Open" on-click="enable(row)"></util-menu-item>
                <util-menu-item label="删除" material-icon="Delete" on-click="delete(row)"></util-menu-item>
                <util-menu-item label="详细" material-icon="Visibility" bind-link="['detail',row.data.id]"></util-menu-item>
            </util-menu>
        </util-button>
    </util-tree-table-column>
</util-tree-table>